home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_wolfsneak.cog < prev    next >
Text File  |  1999-11-15  |  16KB  |  551 lines

  1. # Jones 3D Cog Script
  2. #
  3. # olv_wolfsneak.cog   
  4. #
  5. # [SCHOLL]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message entered
  13. message    startup
  14. message    aievent
  15. message    arrivedwpnt
  16. message timer
  17.  
  18. thing    t_Wolf
  19. thing    t_Indy        local
  20.  
  21. int        n_eventType        local
  22. int        n_CrntAIMode     local
  23. int        n_OldAIMode     local
  24. int        n_Waypoint        local
  25. flex    f_DistToIndy    local 
  26. flex    f_FleeTime        local
  27. int        n_TimerID        local 
  28.  
  29. int        b_OKToStopFlee=0         local
  30. int        b_AttackOnStopFlee=0     local
  31. int        n_idx                    local
  32. int        b_WpntsActive=0            local
  33. int        n_FleeDir                local
  34.  
  35. vector    v_IndyPos        local
  36. vector    v_WolfPos        local
  37. vector    v_Temp            local
  38.  
  39.  
  40.  
  41. # ===========================FLEE WAYPOINTS================================================
  42. int         BASE_WAYPOINT_NUM=32            local
  43. int            NUM_FLEE_WAYPOINTS=25            local
  44. thing        t_Waypoint00
  45. thing        t_Waypoint01
  46. thing        t_Waypoint02
  47. thing        t_Waypoint03
  48. thing        t_Waypoint04
  49. thing        t_Waypoint05
  50. thing        t_Waypoint06
  51. thing        t_Waypoint07
  52. thing        t_Waypoint08
  53. thing        t_Waypoint09
  54. thing        t_Waypoint10
  55. thing        t_Waypoint11
  56. thing        t_Waypoint12
  57. thing        t_Waypoint13
  58. thing        t_Waypoint14
  59. thing        t_Waypoint15
  60. thing        t_Waypoint16
  61. thing        t_Waypoint17
  62. thing        t_Waypoint18
  63. thing        t_Waypoint19
  64. thing        t_Waypoint20
  65. thing        t_Waypoint21
  66. thing        t_Waypoint22
  67. thing        t_Waypoint23
  68. thing        t_Waypoint24
  69.  
  70.  
  71. # ===========================SECTORS================================================
  72.  
  73. int            NUM_AUTO_FLEE_SECTORS=2     local
  74. sector        s_AutoFlee00            mask=0x5 # need entered messages from wolf
  75. sector        s_AutoFlee01            mask=0x5 # need entered messages from wolf
  76.  
  77. int            NUM_ACTIVATE_WPNT_SECTORS=3 local
  78. sector        s_ActivateWpnts00
  79. sector        s_ActivateWpnts01
  80. sector        s_ActivateWpnts02
  81.  
  82. int            NUM_DEACTIVATE_WPNT_SECTORS=3 local
  83. sector        s_DeactivateWpnts00
  84. sector        s_DeactivateWpnts01
  85. sector        s_DeactivateWpnts02
  86.  
  87.  
  88. # ===========================MISC CONSTANTS================================================
  89.  
  90. flex    MIN_FLEE_DISTANCE=2.0            local # distance wolf wants to be from Indy before stopping fleeing
  91. flex    MIN_FLEE_RESTART_DISTANCE=1.0            local # distance wolf wants to be from Indy before stopping fleeing
  92. flex    MAX_FLEEATTACK_DISTANCE=1.0            local # 
  93. flex    MIN_FLEE_TIME=4.0                local 
  94. flex    VARIABLE_FLEE_TIME=3.0            local
  95.  
  96. int        TIMER_ID_OKAY_TO_STOP_FLEE=0    local
  97. int        TIMER_ID_START_FLEE=1            local
  98. int        TIMER_ID_ATTACK=2            local
  99.  
  100. # ===========================SUBROUTINES================================================
  101.  
  102. flex    SetDistToIndy            local
  103. flex    ActivateWaypoints        local
  104. flex    DeactivateWaypoints        local
  105. flex    RankWaypointsForFlee     local
  106. flex    RankWaypointsForFleeToEast local
  107. flex     RankWaypointsForFleeToWest    local
  108. flex    ResetWaypointRanks        local
  109.  
  110. end
  111. # ========================================================================================
  112.  
  113. code
  114. startup:
  115.     t_Indy=GetLocalPlayerThing();
  116.  
  117.     return;
  118.  
  119. # ========================================================================================
  120. entered:
  121.     if (GetSourceRef() == t_Indy)
  122.     {
  123.         for (n_idx = 0; n_idx < NUM_ACTIVATE_WPNT_SECTORS; n_idx = n_idx + 1)
  124.         {
  125.             if (GetSenderRef() == s_ActivateWpnts00[n_idx])
  126.             {
  127.                 call ActivateWaypoints;
  128.             }
  129.         }
  130.         for (n_idx = 0; n_idx < NUM_DEACTIVATE_WPNT_SECTORS; n_idx = n_idx + 1)
  131.         {
  132.             if (GetSenderRef() == s_DeactivateWpnts00[n_idx])
  133.             {
  134.                 call DeactivateWaypoints;
  135.             }
  136.         }
  137.     }
  138.     else if (GetSourceRef() == t_Wolf)
  139.     {
  140.         for (n_idx = 0; n_idx < NUM_AUTO_FLEE_SECTORS; n_idx = n_idx + 1)
  141.         {
  142.             if (GetSenderRef() == s_AutoFlee00[n_idx])
  143.             {
  144. //                DebugPrint("Wolf auto fleeing");
  145.                 AIFlee(t_Wolf, t_Indy);
  146.             }
  147.         }
  148.     }
  149.  
  150.     return;
  151.  
  152. # ========================================================================================
  153. aievent:
  154.     n_eventType        = GetParam(0);
  155.     n_CrntAIMode    = GetParam(1);
  156.     n_OldAIMode        = GetParam(2);    // only valid for certain n_eventType values
  157.  
  158.     if (n_eventType == 0x100)        // SITHAI_EVENTMODECHANGED
  159.     {
  160.         // if changing to flee mode
  161.         // turn on waypoints
  162.         if ( !BITTEST(n_OldAIMode, 0x800) && BITTEST(n_CrntAIMode, 0x800) )
  163.         {
  164. //            DebugPrint("Entering flee mode");
  165.             AISetSubMode(t_Wolf, 0x8000); // SITHAI_SUBMODECONTINUOUSWPNTMOTION
  166.             f_FleeTime = (MIN_FLEE_TIME + (Rand() * VARIABLE_FLEE_TIME));
  167. //            DebugFlex( f_FleeTime, "Flee time");
  168.             SetTimerEx(f_FleeTime , TIMER_ID_OKAY_TO_STOP_FLEE, 0, 0 );
  169.             b_OKToStopFlee = 0;
  170.             call RankWaypointsForFlee;
  171.         }
  172.         // if exiting flee mode
  173.         // turn off waypoints
  174.         else if ( BITTEST(n_OldAIMode, 0x800) && !BITTEST(n_CrntAIMode, 0x800) )
  175.         {
  176.             call SetDistToIndy;
  177.         
  178.             if (b_AttackOnStopFlee)
  179.             {
  180.                 SetTimerEx(0.01 , TIMER_ID_ATTACK, 0, 0);
  181.                 b_AttackOnStopFlee = 0;
  182.                 AIClearSubMode(t_Wolf, 0x8000); // SITHAI_SUBMODECONTINUOUSWPNTMOTION
  183.                 call ResetWaypointRanks;
  184.             }
  185.             // Consider restarting fleeing if Indy too close
  186.             else if (f_DistToIndy < MIN_FLEE_RESTART_DISTANCE)
  187.             {
  188. //                DebugFlex(f_DistToIndy, "Wolf restarting fleeing due to distance");
  189.                 // Restart using timer to avoid nested mode changes
  190.                 SetTimerEx(0.01 , TIMER_ID_START_FLEE, 0, 0 );
  191.             }
  192.             else
  193.             {
  194.                 AIClearSubMode(t_Wolf, 0x8000); // SITHAI_SUBMODECONTINUOUSWPNTMOTION
  195.                 call ResetWaypointRanks;
  196. //                DebugPrint("Exiting flee mode");
  197.             }
  198.         }
  199.     }
  200.  
  201. return;
  202.  
  203. # ========================================================================================
  204. timer:
  205.     t_Indy = GetLocalPlayerThing();
  206.  
  207.     n_TimerID = GetSenderID();
  208.     if (n_TimerID == TIMER_ID_OKAY_TO_STOP_FLEE)
  209.     {
  210.         b_OKToStopFlee = 1;
  211.     }
  212.     else if (n_TimerID == TIMER_ID_START_FLEE)
  213.     {
  214.         call RankWaypointsForFlee;
  215.         AIFlee(t_Wolf, t_Indy);
  216.     }
  217.     else if (n_TimerID == TIMER_ID_ATTACK)
  218.     {
  219.         AISetFireTarget(t_Wolf, t_Indy);
  220.     }
  221.  
  222.  
  223.     return;
  224.  
  225.  
  226. # ========================================================================================
  227. arrivedwpnt:
  228.     n_Waypoint = GetParam(0);
  229.  
  230.     call SetDistToIndy;
  231.  
  232.     if ( b_OKToStopFlee 
  233.          && (f_DistToIndy > MIN_FLEE_DISTANCE)
  234.          && BITTEST(AIGetMode(t_Wolf), 0x800) // fleeing
  235.          && (RandBetween(0,100) < 90)
  236.          )
  237.     {
  238. //        DebugFlex(f_DistToIndy, "Wolf stopping fleeing due to distance");
  239.         // StopThing before StopFlee so wolf will turn to face indy
  240.         StopThing(t_Wolf);
  241.         AIStopFlee(t_Wolf);
  242.     }
  243.     else if ( b_OKToStopFlee 
  244.          && (f_DistToIndy < MAX_FLEEATTACK_DISTANCE)
  245.          && BITTEST(AIGetMode(t_Wolf), 0x800) // fleeing
  246.          && (RandBetween(0,100) < 30)
  247.          )
  248.     {
  249. //        DebugFlex(f_DistToIndy, "Wolf stopping fleeing. Surprise attack");
  250.         b_AttackOnStopFlee = 1;
  251.         AIStopFlee(t_Wolf);
  252.     }
  253.     else if ( (n_FleeDir == -1)
  254.               && BITTEST(AIGetMode(t_Wolf), 0x800) // fleeing
  255.               )
  256.     {
  257.         // fleeing south
  258.         if (n_Waypoint <= (2 + BASE_WAYPOINT_NUM) )
  259.         {
  260.             if (f_DistToIndy > MIN_FLEE_RESTART_DISTANCE)
  261.             {
  262.                 // StopThing before StopFlee so wolf will turn to face indy
  263. //                DebugPrint("Wolf Reached Flee Waypoint and Stopped.");
  264.                 StopThing(t_Wolf);
  265.                 AIStopFlee(t_Wolf);
  266.             }
  267.             else
  268.             {
  269. //                DebugFlex(f_DistToIndy, "Wolf Restarting fleeing.");
  270.                 call RankWaypointsForFlee;
  271.             }
  272.         }
  273.     }
  274.     else if ( (n_FleeDir == 1)
  275.               && BITTEST(AIGetMode(t_Wolf), 0x800) // fleeing
  276.               )
  277.     {
  278.         if (n_Waypoint == (23 + BASE_WAYPOINT_NUM))
  279.         {
  280.             if (f_DistToIndy > MIN_FLEE_RESTART_DISTANCE)
  281.             {
  282.                 // StopThing before StopFlee so wolf will turn to face indy
  283. //                DebugPrint("Wolf Reached Flee Waypoint and Stopped.");
  284.                 StopThing(t_Wolf);
  285.                 AIStopFlee(t_Wolf);
  286.             }
  287.             else
  288.             {
  289. //                DebugFlex(f_DistToIndy, "Wolf Restarting fleeing.");
  290.                 call RankWaypointsForFlee;
  291.             }
  292.         }
  293.     }
  294.  
  295.     return;
  296.  
  297. # ========================================================================================
  298. SetDistToIndy:
  299.     v_IndyPos = GetThingPos(t_Indy);
  300.     v_WolfPos = GetThingPos(t_Wolf);
  301.  
  302.     f_DistToIndy = VectorDist(v_IndyPos, v_WolfPos);
  303.  
  304.     return;
  305.  
  306. # ========================================================================================
  307. ActivateWaypoints:
  308.     if (b_WpntsActive)
  309.     {
  310.         return;
  311.     }
  312.  
  313. //    DebugPrint("ACTIVATING WAYPOINTS FOR WOLF IN SNEAK AREA");
  314.     b_WpntsActive = 1;
  315.     AISetInstinctWpntMode(t_Wolf);
  316.  
  317.     for ( n_idx = 0; n_idx < NUM_FLEE_WAYPOINTS; n_idx = n_idx + 1 )
  318.     {
  319.         AISetWpnt(t_Waypoint00[n_idx], n_idx + BASE_WAYPOINT_NUM);
  320.     }
  321.  
  322.     AIConnectWpnts(0 + BASE_WAYPOINT_NUM, 1 + BASE_WAYPOINT_NUM);
  323.     AIConnectWpnts(0 + BASE_WAYPOINT_NUM, 3 + BASE_WAYPOINT_NUM);
  324.     AIConnectWpnts(0 + BASE_WAYPOINT_NUM, 5 + BASE_WAYPOINT_NUM);
  325.     AIConnectWpnts(1 + BASE_WAYPOINT_NUM, 2 + BASE_WAYPOINT_NUM);
  326.     AIConnectWpnts(1 + BASE_WAYPOINT_NUM, 3 + BASE_WAYPOINT_NUM);
  327.     AIConnectWpnts(2 + BASE_WAYPOINT_NUM, 3 + BASE_WAYPOINT_NUM);
  328.     AIConnectWpnts(2 + BASE_WAYPOINT_NUM, 4 + BASE_WAYPOINT_NUM);
  329.     AIConnectWpnts(3 + BASE_WAYPOINT_NUM, 4 + BASE_WAYPOINT_NUM);
  330.     AIConnectWpnts(3 + BASE_WAYPOINT_NUM, 5 + BASE_WAYPOINT_NUM);
  331.     AIConnectWpnts(3 + BASE_WAYPOINT_NUM, 6 + BASE_WAYPOINT_NUM);
  332.     AIConnectWpnts(4 + BASE_WAYPOINT_NUM, 5 + BASE_WAYPOINT_NUM);
  333.     AIConnectWpnts(4 + BASE_WAYPOINT_NUM, 6 + BASE_WAYPOINT_NUM);
  334.     AIConnectWpnts(5 + BASE_WAYPOINT_NUM, 6 + BASE_WAYPOINT_NUM);
  335.     AIConnectWpnts(5 + BASE_WAYPOINT_NUM, 7 + BASE_WAYPOINT_NUM);
  336.     AIConnectWpnts(5 + BASE_WAYPOINT_NUM, 8 + BASE_WAYPOINT_NUM);
  337.     AIConnectWpnts(6 + BASE_WAYPOINT_NUM, 7 + BASE_WAYPOINT_NUM);
  338.     AIConnectWpnts(6 + BASE_WAYPOINT_NUM, 8 + BASE_WAYPOINT_NUM);
  339.     AIConnectWpnts(7 + BASE_WAYPOINT_NUM, 8 + BASE_WAYPOINT_NUM);
  340.     AIConnectWpnts(7 + BASE_WAYPOINT_NUM, 9 + BASE_WAYPOINT_NUM);
  341.     AIConnectWpnts(7 + BASE_WAYPOINT_NUM, 10 + BASE_WAYPOINT_NUM);
  342.     AIConnectWpnts(8 + BASE_WAYPOINT_NUM, 9 + BASE_WAYPOINT_NUM);
  343.     AIConnectWpnts(8 + BASE_WAYPOINT_NUM, 10 + BASE_WAYPOINT_NUM);
  344.     AIConnectWpnts(9 + BASE_WAYPOINT_NUM, 10 + BASE_WAYPOINT_NUM);
  345.     AIConnectWpnts(9 + BASE_WAYPOINT_NUM, 11 + BASE_WAYPOINT_NUM);
  346.     AIConnectWpnts(10 + BASE_WAYPOINT_NUM, 11 + BASE_WAYPOINT_NUM);
  347.     AIConnectWpnts(11 + BASE_WAYPOINT_NUM, 12 + BASE_WAYPOINT_NUM);
  348.     AIConnectWpnts(12 + BASE_WAYPOINT_NUM, 13 + BASE_WAYPOINT_NUM);
  349.     AIConnectWpnts(13 + BASE_WAYPOINT_NUM, 14 + BASE_WAYPOINT_NUM);
  350.     AIConnectWpnts(13 + BASE_WAYPOINT_NUM, 15 + BASE_WAYPOINT_NUM);
  351.     AIConnectWpnts(13 + BASE_WAYPOINT_NUM, 16 + BASE_WAYPOINT_NUM);
  352.     AIConnectWpnts(14 + BASE_WAYPOINT_NUM, 15 + BASE_WAYPOINT_NUM);
  353.     AIConnectWpnts(14 + BASE_WAYPOINT_NUM, 16 + BASE_WAYPOINT_NUM);
  354.     AIConnectWpnts(15 + BASE_WAYPOINT_NUM, 16 + BASE_WAYPOINT_NUM);
  355.     AIConnectWpnts(15 + BASE_WAYPOINT_NUM, 17 + BASE_WAYPOINT_NUM);
  356.     AIConnectWpnts(15 + BASE_WAYPOINT_NUM, 18 + BASE_WAYPOINT_NUM);
  357.     AIConnectWpnts(16 + BASE_WAYPOINT_NUM, 17 + BASE_WAYPOINT_NUM);
  358.     AIConnectWpnts(16 + BASE_WAYPOINT_NUM, 18 + BASE_WAYPOINT_NUM);
  359.     AIConnectWpnts(17 + BASE_WAYPOINT_NUM, 18 + BASE_WAYPOINT_NUM);
  360.     AIConnectWpnts(17 + BASE_WAYPOINT_NUM, 19 + BASE_WAYPOINT_NUM);
  361.     AIConnectWpnts(17 + BASE_WAYPOINT_NUM, 20 + BASE_WAYPOINT_NUM);
  362.     AIConnectWpnts(18 + BASE_WAYPOINT_NUM, 19 + BASE_WAYPOINT_NUM);
  363.     AIConnectWpnts(18 + BASE_WAYPOINT_NUM, 20 + BASE_WAYPOINT_NUM);
  364.     AIConnectWpnts(19 + BASE_WAYPOINT_NUM, 20 + BASE_WAYPOINT_NUM);
  365.     AIConnectWpnts(19 + BASE_WAYPOINT_NUM, 21 + BASE_WAYPOINT_NUM);
  366.     AIConnectWpnts(19 + BASE_WAYPOINT_NUM, 22 + BASE_WAYPOINT_NUM);
  367.     AIConnectWpnts(20 + BASE_WAYPOINT_NUM, 21 + BASE_WAYPOINT_NUM);
  368.     AIConnectWpnts(20 + BASE_WAYPOINT_NUM, 22 + BASE_WAYPOINT_NUM);
  369.     AIConnectWpnts(21 + BASE_WAYPOINT_NUM, 22 + BASE_WAYPOINT_NUM);
  370.     AIConnectWpnts(21 + BASE_WAYPOINT_NUM, 23 + BASE_WAYPOINT_NUM);
  371.     AIConnectWpnts(21 + BASE_WAYPOINT_NUM, 24 + BASE_WAYPOINT_NUM);
  372.     AIConnectWpnts(22 + BASE_WAYPOINT_NUM, 23 + BASE_WAYPOINT_NUM);
  373.     AIConnectWpnts(22 + BASE_WAYPOINT_NUM, 24 + BASE_WAYPOINT_NUM);
  374.     AIConnectWpnts(23 + BASE_WAYPOINT_NUM, 24 + BASE_WAYPOINT_NUM);
  375.  
  376.     return;
  377.  
  378. # ========================================================================================
  379. DeactivateWaypoints:
  380.     if (!b_WpntsActive)
  381.     {
  382.         return;
  383.     }
  384.  
  385. //    DebugPrint("DEACTIVATING WAYPOINTS FOR WOLF SNEAK");
  386.     b_WpntsActive = 0;
  387.     AIClearInstinctWpntMode(t_Wolf);
  388.     StopThing(t_Wolf);
  389.  
  390.     return;
  391.  
  392.  
  393. # ========================================================================================
  394. RankWaypointsForFlee:
  395.     v_IndyPos = GetThingPos(t_Indy);
  396.     v_WolfPos = GetThingPos(t_Wolf);
  397.  
  398.     // If Indy is in the western arm then flee east
  399.     v_Temp = GetThingPos(t_Waypoint17);
  400.     if (VectorX(v_IndyPos) < VectorX(v_Temp))
  401.     {
  402.         call RankWaypointsForFleeToEast;
  403.         return;
  404.     }
  405.  
  406.     // If Indy is in the eastern/southern arm then flee west
  407.     v_Temp = GetThingPos(t_Waypoint10);
  408.     if (VectorY(v_IndyPos) < VectorY(v_Temp))
  409.     {
  410.         call RankWaypointsForFleeToWest;
  411.         return;
  412.     }
  413.  
  414.     // If Indy is on the main east/west road flee away from him
  415.     v_Temp = GetThingPos(t_Waypoint16);
  416.     if (VectorY(v_IndyPos) < VectorY(v_Temp))
  417.     {
  418.         if (VectorX(v_WolfPos) < VectorX(v_IndyPos))
  419.         {
  420.             call RankWaypointsForFleeToWest;
  421.             return;
  422.         }
  423.         call RankWaypointsForFleeToEast;
  424.         return;
  425.     }
  426.  
  427.  
  428.     // Indy must be at the intersection between road and sneak path
  429.  
  430.     if (VectorY(v_WolfPos) < VectorY(v_IndyPos))
  431.     {
  432.         call RankWaypointsForFleeToEast;
  433.         return;
  434.     }
  435.  
  436.     call RankWaypointsForFleeToWest;
  437.  
  438.     return;
  439.  
  440. # ========================================================================================
  441. RankWaypointsForFleeToEast:
  442.     
  443. //    DebugPrint("Rank waypoints for Flee To East");
  444.     n_FleeDir = -1;
  445.  
  446.     AISetWpntRank(0 + BASE_WAYPOINT_NUM, 240);
  447.     AISetWpntRank(1 + BASE_WAYPOINT_NUM, 240);
  448.     AISetWpntRank(2 + BASE_WAYPOINT_NUM, 240);
  449.  
  450.     AISetWpntRank(3 + BASE_WAYPOINT_NUM, 225);
  451.     AISetWpntRank(4 + BASE_WAYPOINT_NUM, 225);
  452.  
  453.     AISetWpntRank(5 + BASE_WAYPOINT_NUM, 210);
  454.     AISetWpntRank(6 + BASE_WAYPOINT_NUM, 210);
  455.     
  456.     AISetWpntRank(7 + BASE_WAYPOINT_NUM, 195);
  457.     AISetWpntRank(8 + BASE_WAYPOINT_NUM, 195);
  458.  
  459.     AISetWpntRank(9 + BASE_WAYPOINT_NUM, 180);
  460.     AISetWpntRank(10 + BASE_WAYPOINT_NUM, 180);
  461.  
  462.     AISetWpntRank(11 + BASE_WAYPOINT_NUM, 165);
  463.  
  464.     AISetWpntRank(12 + BASE_WAYPOINT_NUM, 150);
  465.  
  466.     AISetWpntRank(13 + BASE_WAYPOINT_NUM, 135);
  467.  
  468.     AISetWpntRank(14 + BASE_WAYPOINT_NUM, 120);
  469.  
  470.     AISetWpntRank(15 + BASE_WAYPOINT_NUM, 105);
  471.     AISetWpntRank(16 + BASE_WAYPOINT_NUM, 105);
  472.  
  473.     AISetWpntRank(17 + BASE_WAYPOINT_NUM, 90);
  474.     AISetWpntRank(18 + BASE_WAYPOINT_NUM, 90);
  475.  
  476.     AISetWpntRank(19 + BASE_WAYPOINT_NUM, 75);
  477.     AISetWpntRank(20 + BASE_WAYPOINT_NUM, 75);
  478.  
  479.     AISetWpntRank(21 + BASE_WAYPOINT_NUM, 60);
  480.     AISetWpntRank(22 + BASE_WAYPOINT_NUM, 60);
  481.  
  482.     AISetWpntRank(23 + BASE_WAYPOINT_NUM, 45);
  483.     AISetWpntRank(24 + BASE_WAYPOINT_NUM, 45);
  484.  
  485.  
  486.     return;
  487.  
  488. RankWaypointsForFleeToWest:
  489.     
  490. //    DebugPrint("Rank waypoints for Flee To West");
  491.     n_FleeDir = 1;
  492.  
  493.     AISetWpntRank(0 + BASE_WAYPOINT_NUM, 0);
  494.     AISetWpntRank(1 + BASE_WAYPOINT_NUM, 0);
  495.     AISetWpntRank(2 + BASE_WAYPOINT_NUM, 0);
  496.  
  497.     AISetWpntRank(3 + BASE_WAYPOINT_NUM, 15);
  498.     AISetWpntRank(4 + BASE_WAYPOINT_NUM, 15);
  499.  
  500.     AISetWpntRank(5 + BASE_WAYPOINT_NUM, 30);
  501.     AISetWpntRank(6 + BASE_WAYPOINT_NUM, 30);
  502.     
  503.     AISetWpntRank(7 + BASE_WAYPOINT_NUM, 45);
  504.     AISetWpntRank(8 + BASE_WAYPOINT_NUM, 45);
  505.  
  506.     AISetWpntRank(9 + BASE_WAYPOINT_NUM, 60);
  507.     AISetWpntRank(10 + BASE_WAYPOINT_NUM, 60);
  508.  
  509.     AISetWpntRank(11 + BASE_WAYPOINT_NUM, 75);
  510.  
  511.     AISetWpntRank(12 + BASE_WAYPOINT_NUM, 90);
  512.  
  513.     AISetWpntRank(13 + BASE_WAYPOINT_NUM, 105);
  514.  
  515.     AISetWpntRank(14 + BASE_WAYPOINT_NUM, 120);
  516.  
  517.     AISetWpntRank(15 + BASE_WAYPOINT_NUM, 135);
  518.     AISetWpntRank(16 + BASE_WAYPOINT_NUM, 135);
  519.  
  520.     AISetWpntRank(17 + BASE_WAYPOINT_NUM, 150);
  521.     AISetWpntRank(18 + BASE_WAYPOINT_NUM, 150);
  522.  
  523.     AISetWpntRank(19 + BASE_WAYPOINT_NUM, 165);
  524.     AISetWpntRank(20 + BASE_WAYPOINT_NUM, 165);
  525.  
  526.     AISetWpntRank(21 + BASE_WAYPOINT_NUM, 180);
  527.     AISetWpntRank(22 + BASE_WAYPOINT_NUM, 180);
  528.  
  529.     AISetWpntRank(23 + BASE_WAYPOINT_NUM, 195);
  530.     AISetWpntRank(24 + BASE_WAYPOINT_NUM, 195);
  531.  
  532.     return;
  533.  
  534. # ========================================================================================
  535. ResetWaypointRanks:
  536.  
  537. //    DebugPrint("Reset waypoint ranks");
  538.  
  539.     n_FleeDir = 0;
  540.     for ( n_idx = 0; n_idx < NUM_FLEE_WAYPOINTS; n_idx = n_idx + 1 ) {
  541.         AISetWpntRank(n_idx + BASE_WAYPOINT_NUM, 0);
  542.     }
  543.  
  544.     return;
  545.  
  546.  
  547.  
  548.  
  549. end
  550.  
  551.